import os
import json
from pymongo import MongoClient
import re
client = MongoClient()
client = MongoClient('192.168.0.220', 27017)
db = client['tjdb']
collection = db['directory']

files = [f for f in os.listdir() if f.endswith('json')]
for file in files:
    with open(file,'rt')as f:
        jsons = json.load(f)
        print(type(jsons))
        collection.insert_one(jsons)
    # break